
import axios from "axios";
import type { InternalAxiosRequestConfig, AxiosResponse } from "axios";


const service = axios.create({
    baseURL: "http://121.89.205.189:3000/admin"
});

// 请求拦截器

// axios.interceptors.request.use();
service.interceptors.request.use((config: InternalAxiosRequestConfig) => {

    let Token = sessionStorage.getItem('token')
    if (Token) {
        config.headers.token = Token
    }


    return config;
});

// 响应拦截器
service.interceptors.response.use((res: AxiosResponse) => {


    return res;
});

export default service;